Skip to content

Expose supported types in ComparatorRegistry#951

Merged
alexander-yevsyukov merged 5 commits into
masterfrom
query-comparator-registry
Jul 2, 2026
Merged

Expose supported types in ComparatorRegistry#951
alexander-yevsyukov merged 5 commits into
masterfrom
query-comparator-registry

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

Summary

Adds a public access method to ComparatorRegistry for retrieving all types that currently have a registered comparator.

  • ComparatorRegistry.types(): Set<Class<*>> returns a defensive snapshot of the registered key types. Modifying the returned set does not affect the registry, and later registrations are not reflected in a previously obtained set.
  • Consistent with the existing register/get/find/contains accessors: @JvmStatic, single-expression body, KDoc documenting the snapshot contract.

Tests

Three new cases in ComparatorRegistrySpec:

  • exposes the provider-registered types (Timestamp, Duration);
  • includes a newly registered type among the supported types;
  • returns a snapshot that does not reflect a later registration.

All 8 tests in the spec pass.

Version

Bumped 2.0.0-SNAPSHOT.422 -> 2.0.0-SNAPSHOT.423 and regenerated dependency reports. The deprecated by extra(...) delegate in version.gradle.kts was migrated to extra.set(...).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 2, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes the set of comparator key types registered in ComparatorRegistry via a new types() accessor, and updates the repository version and generated dependency reports. It also includes several build tooling updates in buildSrc that affect version parsing, dependency report generation, and temporary directory handling.

Changes:

  • Add ComparatorRegistry.types(): Set<Class<*>> returning a defensive snapshot of registered comparator key types, plus new tests.
  • Bump publishing version to 2.0.0-SNAPSHOT.423 and regenerate dependency report artifacts under docs/dependencies/.
  • Update build tooling (buildSrc) around extra.set(...) parsing, dependency report version selection based on resolution, and temp directory utilities/tests.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version.gradle.kts Bumps the published version and migrates to extra.set(...).
docs/dependencies/pom.xml Regenerated dependency POM reflecting updated dependency versions/metadata.
docs/dependencies/dependencies.md Regenerated dependency/license report with updated version/date stamps.
buildSrc/src/test/kotlin/io/spine/gradle/VersionGradleFileSpec.kt Adds test coverage for parsing extra.set(...) declarations.
buildSrc/src/test/kotlin/io/spine/gradle/report/pom/DependencyWriterSpec.kt Expands tests to validate resolved-vs-declared dependency version reporting.
buildSrc/src/test/kotlin/io/spine/gradle/fs/SpineTempDirSpec.kt New tests for per-JVM temp directory behavior.
buildSrc/src/test/kotlin/io/spine/gradle/fs/LazyTempPathSpec.kt New tests for lazy temp path creation and placement.
buildSrc/src/main/kotlin/write-manifest.gradle.kts Adjusts task registration style for exposeManifestForTests.
buildSrc/src/main/kotlin/uber-jar-module.gradle.kts Updates task wiring for publishing fat JAR to Maven Local.
buildSrc/src/main/kotlin/kmp-module.gradle.kts Adjusts KMP source set access and configures jvmTest execution/logging.
buildSrc/src/main/kotlin/jvm-module.gradle.kts Updates task registration style for generated-source cleanup.
buildSrc/src/main/kotlin/io/spine/gradle/VersionGradleFile.kt Extends version file parsing to support extra.set(...) alongside legacy by extra(...).
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ProjectMetadata.kt Refactors property delegation implementation details.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt Changes dependency reporting to prefer resolved versions from Gradle resolution results.
buildSrc/src/main/kotlin/io/spine/gradle/fs/SpineTempDir.kt New per-JVM temp directory utility with shutdown cleanup hook.
buildSrc/src/main/kotlin/io/spine/gradle/fs/LazyTempPath.kt Switches temp directory creation to use the shared per-JVM base directory.
buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt Bumps fallback compiler versions.
base/src/test/kotlin/io/spine/compare/ComparatorRegistrySpec.kt Adds tests validating supported-type exposure and snapshot semantics.
base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Adds types() API exposing registered comparator key types as a snapshot.

Comment thread base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 2, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to In Review in v2.0 Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.02%. Comparing base (09e84cc) to head (2d0d09f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #951   +/-   ##
=======================================
  Coverage   94.02%   94.02%           
=======================================
  Files         192      192           
  Lines        4186     4187    +1     
  Branches      346      346           
=======================================
+ Hits         3936     3937    +1     
  Misses        149      149           
  Partials      101      101           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-yevsyukov alexander-yevsyukov merged commit c324bc7 into master Jul 2, 2026
11 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the query-comparator-registry branch July 2, 2026 16:46
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants